Use the correct interface for creating an alternative registry source id.
authorChris Swindle <christopher.swindle@metaswitch.com>
Wed, 1 Nov 2017 22:28:28 +0000 (22:28 +0000)
committerChris Swindle <christopher.swindle@metaswitch.com>
Wed, 1 Nov 2017 22:28:28 +0000 (22:28 +0000)
src/cargo/core/source/source_id.rs
src/cargo/ops/registry.rs

index e7b43089483f415f8b8f9a2d1c3305326d2099fa..4d0ef32c9630ca2537e220d7dd5d33d929f78df4 100644 (file)
@@ -150,11 +150,6 @@ impl SourceId {
         SourceId::new(Kind::Registry, url.clone())
     }
 
-    /// Create a SourceId from an alternative registry url
-    pub fn for_alt_registry(url: &Url) -> CargoResult<SourceId> {
-        SourceId::new(Kind::AltRegistry, url.clone())
-    }
-
     /// Create a SourceId from a local registry path
     pub fn for_local_registry(path: &Path) -> CargoResult<SourceId> {
         let url = path.to_url()?;
index 9b536b21d557fd0835fb39f71c2f595e549d4647..4f841d06ff6497627c9af7f6031b0458a82dc6d0 100644 (file)
@@ -243,7 +243,7 @@ pub fn registry(config: &Config,
     } = registry_configuration(config, registry.clone())?;
     let token = token.or(token_config);
     let sid = match (index_config, index, registry) {
-        (Some(index), _, Some(_registry)) => SourceId::for_alt_registry(&index.to_url()?)?,
+        (_, _, Some(registry)) => SourceId::alt_registry(config, &registry)?,
         (Some(index), _, _) | (None, Some(index), _) => SourceId::for_registry(&index.to_url()?)?,
         (None, None, _) => SourceId::crates_io(config)?,
     };